package com.jd.basic.util;


import lombok.Data;

@Data
public class AjaxResult {

    private Boolean success = true;
    private String message = "操作成功";
    // 所有数据类型的数据
    private Object resultObj;

    public AjaxResult(Boolean success, String message) {
        this.success = success;
        this.message = message;
    }
    public AjaxResult() {}

    /**
     * 构建链式语法
     * @return
     */
    public static AjaxResult me(){
        return new AjaxResult();
    }

    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }
    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
